Destructor for self_organizing_map
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(self_organizing_map) | :: | kohonen_map |
A |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | ix | ||||
integer, | public | :: | iy | ||||
integer, | public | :: | iz |
subroutine destroy_som(kohonen_map) !======================================================================================== !! Destructor for self_organizing_map class(self_organizing_map) :: kohonen_map !! A `self_organizing_map` object integer :: ix,iy,iz ! ! write(*,*) 'SOM: Releasing memory...' if(allocated(kohonen_map%grid)) then do iz=1,size(kohonen_map%grid,3) do iy=1,size(kohonen_map%grid,2) do ix=1,size(kohonen_map%grid,1); call kohonen_map%grid(ix,iy,iz)%destroy(); enddo enddo enddo deallocate(kohonen_map%grid); endif ! if(allocated(kohonen_map%number_patterns)) then deallocate(kohonen_map%number_patterns); endif ! if(allocated(kohonen_map%cells_index)) then deallocate(kohonen_map%cells_index); endif ! if(allocated(kohonen_map%u_matrix)) then deallocate(kohonen_map%u_matrix); endif ! if(allocated(kohonen_map%distance_function)) then deallocate(kohonen_map%distance_function); endif ! if(allocated(kohonen_map%distance)) then deallocate(kohonen_map%distance); endif ! if(allocated(kohonen_map%cells_distances)) then deallocate(kohonen_map%cells_distances); endif ! if(allocated(kohonen_map%coordinates)) then deallocate(kohonen_map%coordinates); endif ! if(allocated(kohonen_map%distortion)) then deallocate(kohonen_map%distortion) endif ! if(allocated(kohonen_map%grid_pattern_index)) then deallocate(kohonen_map%grid_pattern_index); endif ! if(allocated(kohonen_map%list_node_grid)) then deallocate(kohonen_map%list_node_grid); endif call kohonen_map%rnumber_grator%destroy(); ! ! write(*,*) 'SOM: Releasing memory...OK!' ! end subroutine destroy_som